From: Keir Fraser Date: Fri, 11 Dec 2009 08:45:26 +0000 (+0000) Subject: libxenlight: fix two memory related issues X-Git-Tag: archive/raspbian/4.8.0-1+rpi1~1^2~12934 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=44ed88bd6bd53c9150fc532eb9028378e0384ce3;p=xen.git libxenlight: fix two memory related issues - LIBXL_MAXMEM_CONSTANT is 1MB but must be expressed in KB; - xc_dom_linux_build should take target_memkb instead of max_memkb as an argument. Thanks to Andres for spotting the latter. Signed-off-by: Stefano Stabellini --- diff --git a/tools/libxl/libxl_dom.c b/tools/libxl/libxl_dom.c index 60affe9207..b96e5e6258 100644 --- a/tools/libxl/libxl_dom.c +++ b/tools/libxl/libxl_dom.c @@ -130,7 +130,7 @@ int build_pv(struct libxl_ctx *ctx, uint32_t domid, XL_LOG_ERRNO(ctx, XL_LOG_ERROR, "xc_dom_allocate failed"); return -1; } - if ((ret = xc_dom_linux_build(ctx->xch, dom, domid, info->max_memkb / 1024, + if ((ret = xc_dom_linux_build(ctx->xch, dom, domid, info->target_memkb / 1024, info->kernel, info->u.pv.ramdisk, flags, state->store_port, &state->store_mfn, state->console_port, &state->console_mfn)) != 0) { diff --git a/tools/libxl/libxl_internal.h b/tools/libxl/libxl_internal.h index b793430ef9..fd7838858c 100644 --- a/tools/libxl/libxl_internal.h +++ b/tools/libxl/libxl_internal.h @@ -31,7 +31,7 @@ #define LIBXL_DEVICE_MODEL_START_TIMEOUT 10 #define LIBXL_XENCONSOLE_LIMIT 1048576 #define LIBXL_XENCONSOLE_PROTOCOL "vt100" -#define LIBXL_MAXMEM_CONSTANT (1 * 1024 * 1024) +#define LIBXL_MAXMEM_CONSTANT 1024 #define QEMU_SIGNATURE "QemuDeviceModelRecord" #define ARRAY_SIZE(a) (sizeof(a) / sizeof(a[0]))